import { Button } from "antd";
import Link from 'next/link';
import { redirect } from 'next/navigation';

export default function Home() {
  // const navigate = useRouter();

  const handleNavigate = () => {
    redirect('/about'); // Use the router to navigate to the about page
  };

  return (
    <div className="flex min-h-screen flex-col items-center">
      <Button>Ant Design Button</Button>

      {/* Link component */}
      <ul>
        <li><Link href="/about">Go to About Page</Link></li>
        <li><Link href="/detail">Go to Detail Page</Link></li>
        <li><Link href="/list">Go to List Page</Link></li>
        <li><Link href="/hello">Go to Hello Page</Link></li>
      </ul>

      {/* Programmatically navigate using the useRouter hook */}
      {/* <Button onClick={handleNavigate}>Go to About Page (Using Button)</Button> */}
    </div>
  );
}
